cmake_minimum_required(VERSION 3.8)
project(addcustomcommand_main_dependency)
#add_custom_command(OUTPUT main_dependency COMMAND cat ${PROJECT_SOURCE_DIR}/a.txt > b.txt)
add_custom_command(OUTPUT main_dependency MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/a.txt COMMAND cat ${PROJECT_SOURCE_DIR}/a.txt > b.txt)
add_custom_target(main_dependency_target DEPENDS main_dependency)
